//
//  ActivityViewController.m
//  MyProject
//
//  Created by dllo on 15/11/2.
//  Copyright (c) 2015年 蓝鸥0825. All rights reserved.
//

#import "ActivityViewController.h"
#import "ActivityTableView.h"
#import "WHZAfnetWorking.h"

#import "ActivityModel.h"

#define WIDTH self.view.frame.size.width
#define HEIGHT self.view.frame.size.height
@interface ActivityViewController ()

@end

@implementation ActivityViewController

- (void)viewDidLoad {
    [super viewDidLoad];
    self.title = @"最 IN 活动";
    
    ActivityTableView *activity = [[ActivityTableView alloc] initWithFrame:CGRectMake(0, 0,WIDTH, HEIGHT)];
    [self.view addSubview:activity];
    activity.VC = self;
    
    [WHZAfnetWorking GETJRAfnNetworkingWithUrl:@"http://api.meishi.cc/v5/huodong_list.php?format=json" WithParameters:nil Block:^(id result) {
        
        self.dictionaryActivity = result;
        self.arrayActivity = [ActivityModel baseModelByArr:self.dictionaryActivity[@"huodong_list"]];
        activity.arrayActivity = self.arrayActivity;
        [activity.table reloadData];
    
    }];
//    NSLog(@"%@", self.dictionaryActivity);
    
}

- (void)didReceiveMemoryWarning {
    
    [super didReceiveMemoryWarning];

}


@end
